<?php

namespace app\admin\validate;

use think\Validate;

class BoxAdValidate extends Validate
{
    protected $rule =   [
        'id'=>'require',
        'title'  => 'require',
        'cover'   => 'require',
        'status' => 'require|in:1,2',
        'device' => 'require',
        'url'=>'require',
        'pop_scene'=>'require'
    ];

    protected $message  =   [
        'id.require' => '记录必须',
        'title.require' => '广告名称必须',
        'cover.require'   => '图片必须',
        'status.require'  => '状态必须',
        'device.require' => '投放设备必须',
        'url.require' => 'URL必须',
        'pop_scene.require' => '弹出场景必须',
    ];
    protected $scene = [
        'banner'  =>  ['id','title','cover','status','device'],
        'spread'  =>  ['id','title','cover','status','device'],
        'popup'  =>  ['id','title','cover','status','device','url','pop_scene'],
    ];
}